﻿
Imports System.Data.SqlClient
Imports Infragistics.WebUI.WebSchedule

Public Class _Default
    Inherits System.Web.UI.Page
    Private et As New ETModelContainer
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        WebScheduleSqlClientProvider1.Connect(My.Settings.AltDBConn)


        WebMonthView1.EnableAutoActivityDialog = CType(Master, IMasterPage).CurrentUser.IsInRole(UNIT_SCHEDULER, ANY_UNITS, et)

        If Not IsPostBack Then
            chkCalendars.DataSource = CType(Me.Master, IMasterPage).CurrentUser.OrgHiarchy(et)
            chkCalendars.DataTextField = "OrganizationName"
            chkCalendars.DataValueField = "OrganizationID"
            chkCalendars.DataBind()

        End If





    End Sub

 

 
 

    Private Sub WebScheduleInfo1_ResourcesFetched(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebScheduleInfo1.ResourcesFetched

        For Each li As ListItem In chkCalendars.Items
            If Not li.Selected Then
                Dim r As Resource = WebScheduleInfo1.VisibleResources.GetResourceFromName(li.Text)
                If Not r Is Nothing Then
                    If Not r.IsUnassigned Then
                        WebScheduleInfo1.VisibleResources.Remove(r)
                    End If
                End If



            End If
        Next


 
    End Sub

 
End Class